package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.mapper.entity.SysMenu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.awt.*;
import java.util.List;

/**
 * @author Lucy
 * @create 2024-02-03 21:06
 */
@Mapper
@Repository
public interface SysMenuMapper{
    @Select("SELECT * FROM sys_menu WHERE menu_parent = 0 AND menu_type = 2")
    List<SysMenu> selectMenuList();
    @Select("SELECT * FROM sys_menu WHERE menu_parent = #{parentId}")
    List<SysMenu> selectMenuListByParentId(Integer parentId);
    @Select("SELECT COUNT(*) FROM sys_menu WHERE menu_parent = #{menuId}")
    int selectSubMenuCountByParentId(int menuId);
    @Select("SELECT menu_id FROM sys_role_menu WHERE role_id = #{roleId}")
    List<Integer> findMenuIdBySysRoleId(int roleId);
}
